#include "mainwindow.h"
#include "ui_mainwindow.h"


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

   m_pSpeedPanel = new SpeedPanel();
   //m_pSpeedPanel->show();
   this->setCentralWidget(m_pSpeedPanel);

   m_pSpeedPanel->setValue(77);

   timer = new QTimer(this);
   timer->setInterval(50);
   connect(timer, SIGNAL(timeout()), this, SLOT(processOneThing()));
   timer->start();

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::processOneThing()
{
    static double value  = 0;
    value += 0.1;
    if(value > 100)
    {
        value = 0;
    }

    m_pSpeedPanel->setValue(value);
}

